package cn.jtfadmin.cms.domain.entity;

import cn.jtfadmin.base.data.jpa.domain.entity.BaseEntity;
import cn.jtfadmin.base.filesystem.annos.File;
import cn.jtfadmin.base.lang.enums.FileType;
import cn.jtfadmin.core.modules.sys.domain.entity.SysDepartEntity;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;

/**
 * cms 页面信息
 * @author jtf
 * @since 0.0.2
 */
@Getter
@Setter
@Entity
@Table(name = "cms")
public class CmsEntity extends BaseEntity {


    /**
     * 标题 head <meta name="title" content="title"/>
     */
    @Column(name = "title")
    protected String title;

    /**
     * 关键字 head <meta name="keywords" content="title"/>
     */
    @Column(name = "keywords")
    protected String keywords;

    /**
     * 页面描述 head <meta name="description" content="title"/>
     */
    @Column(name = "description")
    protected String description;


    /**
     * 图标
     */
    @Column(name = "logo")
    @File(dirName = "cms_logo", describe = "网站logo", fileType= FileType.IMAGE)
    protected String logo;


    /**
     * 域名
     */
    @Column(name = "domain", unique = true, nullable = false)
    protected String domain;

    /**
     * 网站名称
     */
    @Column(name = "name")
    protected String name;

    /**
     * js 增强
     */
    @Column(name = "script_add")
    @Lob
    protected String scriptAdd;

    /**
     * css 增强
     */
    @Column(name = "style_add")
    @Lob
    protected String styleAdd;


    /**
     * 版权
     */
    @Column(name = "copyright")
    protected String copyright;

    /**
     * 备案号
     */
    @Column(name = "record_num")
    protected String recordNum;

    @ManyToOne()
    @JoinColumn(name = "sys_depart_id", nullable = false)
    protected SysDepartEntity sysDepart;


}
